<template>
  <div class="Person">
     <h3>
        姓名：{{ name }}
     </h3>
     <h3>
        年龄：{{ age }}
     </h3>
     <button @click="showNum"> 获取联系方式 </button>
  </div>
</template>

<script lang="ts">
export default {
    name:'Person',
  data() {
    return {
        name:'zhangsan',
        age:'14',
        number:'13012345678'
    }
  },
  methods:{
    showNum(){
        alert(this.number)
    }
  }
}
</script>

<style scoped>
.Person{
  margin: 20px auto;
  background-color: skyblue;
  border-radius: 20px;
  box-shadow: 0 0 10px;
  padding: 20px;
  text-align: center;
}
</style>